/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package org.bofaconnectors.provision;

import com.thortech.xl.dataaccess.tcDataProvider;
import java.util.Map;
import org.oimwrapper.connectors.OIMAdapterBase;

/**
 *
 */
public class ProvisioningDebug extends OIMAdapterBase implements ProvisioningInterface {
    
    public ProvisioningDebug(tcDataProvider database)
    {
        super(ProvisioningDebug.class.getName().toUpperCase(),database);
        System.out.println("LOGGER CLASS:" + ProvisioningDebug.class.getName().toUpperCase());
    }
    
    public void dummyMethod()
    {

    }

    public String showProcessFormData(long instanceKey)
    {
        Map formData = null;
        logger.debug("Process Data Instance:" + instanceKey);
        
        try
        {
            formData = getProcessFormValues(instanceKey);
            logger.debug("Parent Data:" + formData);
            
            String[] children = this.getChildTables(instanceKey);
            for(int c=0;c<children.length;c++)
            {
                String childTable = children[c];
                logger.debug("Child Table:" + childTable);
                Map[] childForm = this.getProcessFormChildValues(instanceKey, childTable);
                for(int cc=0;cc<childForm.length;cc++)
                {
                    logger.debug("ChildData:" + childForm[cc]);
                }
            }
        }
        catch(Exception e)
        {
            logger.error("APIError",e);
            return FAILURE;
        }
        return SUCCESS;
    }

}
